<%@page import="com.zaofan.bean.Admin"%>
<%@page import="com.zaofan.bean.AdminType"%>
<%@page import="com.zaofan.constant.PowerIndex"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" 
           uri="http://java.sun.com/jsp/jstl/core" %>
<!DOCTYPE html>
<%
	String contextPath = request.getContextPath();
	Admin admin = (Admin)session.getAttribute("admin");
	
	if(admin == null){
		response.sendRedirect(contextPath + "/login.jsp?state=" + "session-invalid");
		return;
	}
/* 	if(admin.getType() != AdminType.admin.ordinal() &&  admin.getType() != 4){
		response.sendRedirect(contextPath + "/login.jsp?state=" + "session-invalid");
		return;
	} */
%>
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="renderer" content="webkit" />
<title>后台</title>
 <script src="assets/js/jquery-1.10.2.min.js"></script>
<link href="assets/css/bootstrap.min.css" rel="stylesheet" />
<link rel="stylesheet" href="assets/css/font-awesome.min.css" />
<!--[if IE 7]>
	<link rel="stylesheet" href="assets/css/font-awesome-ie7.min.css" />
<![endif]-->
<link rel="stylesheet" href="assets/css/ace.min.css" />
<link rel="stylesheet" href="assets/css/ace-rtl.min.css" />
<link rel="stylesheet" href="assets/css/ace-skins.min.css" />
<!--[if lte IE 8]>
	<link rel="stylesheet" href="assets/css/ace-ie.min.css" />
<![endif]-->
<script src="assets/js/ace-extra.min.js"></script>

<!--[if lt IE 9]>  
      <script src="js/html5shiv.js"></script>  
      <script src="js/respond.min.js"></script>  
<![endif]-->
<script type="text/javascript">      
        var contextPath='<%=contextPath%>';
</script>
<script language="javascript">
	if (top != window)
		top.location.href = window.location.href;
</script>
</head>
<body>
	<div class="navbar navbar-default" id="navbar">
		<script type="text/javascript">
			try {
				ace.settings.check('navbar', 'fixed')
			} catch (e) {
			}
		</script>
		<div class="navbar-container" id="navbar-container">
			<div class="navbar-header pull-left">
				<a href="#" class="navbar-brand"> <small> <i
						class="icon-leaf"></i> 欢迎你
				</small>
				</a>
				<!-- /.brand -->
			</div>
			<!-- /.navbar-header -->
			<div class="navbar-header pull-right" role="navigation">

				<ul class="nav ace-nav">
				<li class="light-blue"><a data-toggle="dropdown" href="#"
						class="dropdown-toggle"> <span class="user-info"> <small>欢迎光临,</small><%=admin.getName()%>
						</span> <i class="icon-caret-down"></i>
					</a>
						<ul
							class="user-menu pull-right dropdown-menu dropdown-yellow dropdown-caret dropdown-close">
							<li><a href="<%=contextPath%>/admin?action=loginOut">
									<i class="icon-off"></i> 退出
							</a></li>
							<li><a href="<%=contextPath%>/admin/modify_pass.jsp" target="content">
									<i class="icon-crog"></i> 修改密码
							</a></li>
						</ul></li>
				</ul>
				<!-- /.ace-nav -->
			</div>
			<!-- /.navbar-header -->
		</div>
		<!-- /.container -->
	</div>
	<div class="main-container" id="main-container">
		<script type="text/javascript">
			try {
				ace.settings.check('main-container', 'fixed')
			} catch (e) {
			}
		</script>
		<div class="main-container-inner">
			<a class="menu-toggler" id="menu-toggler" href="#"> <span
				class="menu-text"></span>
			</a>

			<div class="sidebar" id="sidebar">
				<script type="text/javascript">
					try {
						ace.settings.check('sidebar', 'fixed')
					} catch (e) {
					}
				</script>

				<ul class="nav nav-list" id="nav-list">
					<li class="active"><a href="index.jsp"> <i
							class="icon-home"></i> <span class="menu-text"> 控制台 </span>
					</a></li>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.USER.getCode()) == '1'); %>
					<c:if test="${show}">
						<li><a href="#" class="dropdown-toggle"> <i
								class="icon-user"></i> <span class="menu-text"> 会员中心 </span> <b
								class="arrow icon-angle-down"></b>
						</a>
							<ul class="submenu">
								<li><a href="user/userList.jsp" class="dropdown-toggle"
									target="content"> <i class="icon-double-angle-right"></i>
										会员列表
								</a></li>
								<li><a href="user/rankList.jsp" class="dropdown-toggle"
									target="content"> <i class="icon-double-angle-right"></i>
										会员等级
								</a></li>
							</ul></li>
					</c:if>
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.ORDER.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-th"></i> <span class="menu-text"> 订单管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<%pageContext.setAttribute("show", !admin.getName().equals("zaofan003")); %>
							<c:if test="${show}">
							<li ><a href="order/todayOrderList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									今日订单
							</a></li>
							</c:if>

							<li><a href="order/tomorrowOrderList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									明日送货订单

							<li><a href="order/yesterdayOrderList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									今日送货订单
							</a></li>
							<li><a href="order/orderRefunds.jsp" class="dropdown-toggle"
								   target="content"> <i class="icon-double-angle-right"></i>
								    退款订单管理
							</a></li>

							<!-- <li><a href="order/jishiOrderList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									及时订单处理
							</a></li>
							<li><a href="javascript:void(0)" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									小区订单
							</a></li> -->
							<%--<%pageContext.setAttribute("show", !admin.getName().equals("zaofan003")); %>--%>
							<%--<c:if test="${show}">--%>
							<li><a href="order/orderList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									订单列表
							</a></li>
							<%--</c:if>--%>
							<!-- <li><a href="order/order_char.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									产品销售记录
							</a></li> -->
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.CONTENT.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-th"></i> <span class="menu-text"> 内容管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="indexImg/AdList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									广告管理
							</a></li>
							<li><a href="<%=contextPath %>/admin/article?action=list2" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									文章管理
							</a></li>
							<li><a href="<%=contextPath %>/admin/message?action=list" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									消息管理
							</a></li>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.COMMENT.getCode()) == '1'); %>
					<c:if test="${show}">
						<li><a href="#" class="dropdown-toggle"> <i
							class="icon-th"></i> <span class="menu-text"> 评论管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="complaints/complaintsList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									投诉列表
							</a></li>
							<li><a href="comment/commentList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									评论列表
							</a></li>
							<li><a href="comment/feedBackList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									反馈列表
							</a></li>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.ACTIVITY.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-th"></i> <span class="menu-text"> 活动管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="activity/ActivityList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									活动管理
							</a></li>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.RECHARGE.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-th"></i> <span class="menu-text"> 在线充值 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="recharge/rechargeList.jsp" class="dropdown-toggle"
								   target="content"> <i class="icon-double-angle-right"></i>
								充值管理
							</a></li>
							<%--<li>--%>
								<%--<a href="recharge/rechargeReturnList.jsp" class="dropdown-toggle" target="content">--%>
									<%--<i class="icon-double-angle-right"></i>--%>
									<%--充值返还(福州)--%>
								<%--</a>--%>
							<%--</li>--%>
						</ul>

					</li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.PREPAID.getCode()) == '1'); %>
					<c:if test="${show}">
					<li>
						<a href="#" class="dropdown-toggle">
							<i class="icon-th"></i>
							<span class="menu-text"> 充值管理 </span>
							<b class="arrow icon-angle-down"></b>
						</a>

						<ul class="submenu">
							<li>
								<a href="prepaid/prepaidList.jsp" class="dropdown-toggle" target="content">
									<i class="icon-double-angle-right"></i>
									充值管理
								</a>
							</li>

						</ul>

					</li>

					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.AREA.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-group"></i> <span class="menu-text"> 区域管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="city/cityList.jsp"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 开通区域
							</a></li>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.SHOP.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-group"></i> <span class="menu-text"> 商家管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="shop/shopList.jsp"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 商家管理
							</a></li>
							<li><a href="shop/TimeManager.jsp"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 时间管理
							</a></li>
							<li><a href="shop/HotelTimeManager.jsp"
								   class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 酒店时间管理
							</a></li>
							<li><a href="shop/ProductClassList.jsp"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 分类管理
							</a></li>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.CARRIER.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-group"></i> <span class="menu-text"> 运营商管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="carrier/carrierList.jsp"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 运营商管理
							</a></li>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.GOODS.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-group"></i> <span class="menu-text"> 商城管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="goods/goodsList.jsp"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 产品管理
							</a></li>
							<li><a href="goods/goodsTypeList.jsp"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 类别管理
							</a></li>
							<%pageContext.setAttribute("show", !admin.getName().equals("zf0012") && !admin.getName().equals("zf0012_xm") ); %>
							<c:if test="${show}">
							<li><a href="goodsOrder/orderList.jsp"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 全部订单
							</a></li>
							<li><a href="goodsOrder/todayOrderList.jsp"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 今日下单
							</a></li>
							</c:if>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.FANS.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-group"></i> <span class="menu-text"> 范粉管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="<%=contextPath %>/admin/topic?action=list"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 话题管理
							</a></li>
							<li><a href="<%=contextPath %>/admin/dynamic?action=list"
								class="dropdown-toggle" target="content"> <i
									class="icon-double-angle-right"></i> 动态管理
							</a></li>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.SITE.getCode()) == '1'); %>
					<c:if test="${show}">
					<li><a href="#" class="dropdown-toggle"> <i
							class="icon-gear"></i> <span class="menu-text"> 网站信息管理 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="setting/setting.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									参数配置
							</a></li>
							<li><a href="setting/version.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									App版本配置
							</a></li>
							<li><a href="<%=contextPath %>/admin/log?action=list2" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									版本更新记录
							</a></li>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.OPEN.getCode()) == '1'); %>
					<c:if test="${show}">
						<li><a href="#" class="dropdown-toggle"> <i
							class="icon-gear"></i> <span class="menu-text"> 申请开通 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="appy/appyList.jsp"  class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									开通列表
							</a></li>
							<li><a href="appy/appyCheckList.jsp" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									开通审核
							</a></li>
						</ul></li>
					</c:if>
					
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.REFRESH.getCode()) == '1'); %>
					<c:if test="${show}">
						<li><a href="#" class="dropdown-toggle"> <i
							class="icon-gear"></i> <span class="menu-text"> 网站数据更新 </span> <b
							class="arrow icon-angle-down"></b>
					</a>
						<ul class="submenu">
							<li><a href="javascript:void(0)" id="cacheFlush" class="dropdown-toggle"
								target="content"> <i class="icon-double-angle-right"></i>
									数据更新
							</a></li>
						</ul></li>
					</c:if>

					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.QrCode.getCode()) == '1'); %>
					<c:if test="${show}">
						<li><a href="#" class="dropdown-toggle"> <i
								class="icon-group"></i> <span class="menu-text"> 营销管理 </span> <b
								class="arrow icon-angle-down"></b>
						</a>
							<ul class="submenu">
								<li>
									<a href="qrCode/memberList.jsp"
									   class="dropdown-toggle" target="content"> <i
										class="icon-double-angle-right"></i> 人员管理
								</a>
								</li>
								<li>
									<a href="qrCode/CreateQRCODE.jsp"
									   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 二维码绑定
									</a>
								</li>
								<li>
									<a href="qrCode/todayNewUserList.jsp"
									   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 今日新增用户
									</a>
								</li>
								<li>
									<a href="qrCode/todayNewOrderList.jsp"
									   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 今日新增订单
									</a>
								</li>
								<li>
									<a href="qrCode/allUserList.jsp"
									   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 营销人员总用户
									</a>
								</li>
								<li>
									<a href="qrCode/allOrderList.jsp"
									   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 营销人员总订单
									</a>
								</li>
								<li>
									<a href="qrCode/newUserOrder.jsp"
									   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 营销人员新增订单
									</a>
								</li>
							</ul>

						</li>

					</c:if>
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.Coupon.getCode()) == '1'); %>
					<c:if test="${show}">
						<li><a href="#" class="dropdown-toggle"> <i
								class="icon-group"></i> <span class="menu-text"> 签到抽奖管理 </span> <b
								class="arrow icon-angle-down"></b>
						</a>
							<ul class="submenu">
								<li>
								<a href="coupon/couponList.jsp"
								   class="dropdown-toggle" target="content"> <i
										class="icon-double-angle-right"></i> 优惠券列表
								</a>
								</li>
								<li>
									<a href="coupon/sendCoupon.jsp"
									   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 发放优惠券
									</a>
								</li>
								<li>
									<a href="qiandao/guaguale.jsp"

									   		   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 刮刮乐奖品管理
									</a>
								</li>
								<li>
									<a href="choujiang/choujiang.jsp"
									   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 每日抽奖奖品管理
									</a>
								</li>
							</ul>

						</li>
					</c:if>
					<%pageContext.setAttribute("show", admin.getPower().charAt(PowerIndex.Hotel.getCode()) == '1'); %>
					<c:if test="${show}">
						<li><a href="#" class="dropdown-toggle"> <i
								class="icon-group"></i> <span class="menu-text"> 酒店管理 </span> <b
								class="arrow icon-angle-down"></b>
						</a>
							<ul class="submenu">
								<li>
									<a href="hotel/createHotel.jsp"
									   class="dropdown-toggle" target="content"> <i
											class="icon-double-angle-right"></i> 新增酒店
									</a>
								</li>
							</ul>

						</li>
					</c:if>
					
				</ul>
				<!-- /.nav-list -->
				<div class="sidebar-collapse" id="sidebar-collapse">
					<i class="icon-double-angle-left"
						data-icon1="icon-double-angle-left"
						data-icon2="icon-double-angle-right"></i>
				</div>

				<script type="text/javascript">
					try {
						ace.settings.check('sidebar', 'collapsed')
					} catch (e) {
					}
				</script>
			</div>

			<div class="main-content row" style="background-color: #fff;">

				<iframe src="welcome.html" frameborder="0"
					style="height: 100%; width: 100%;" name="content"></iframe>
			</div>
			<!-- /.main-content -->
		</div>
		<!-- /.main-container-inner -->

		<a href="#" id="btn-scroll-up"
			class="btn-scroll-up btn btn-sm btn-inverse"> <i
			class="icon-double-angle-up icon-only bigger-110"></i>
		</a>
	</div>
	<!-- /.main-container -->
	
	<script src="assets/js/bootstrap.min.js"></script>
	<script src="assets/js/typeahead-bs2.min.js"></script>
	<!--[if lte IE 8]>
	<script src="assets/js/excanvas.min.js"></script>
<![endif]-->
	<script src="assets/js/jquery-ui-1.10.3.custom.min.js"></script>
	<script src="assets/js/jquery.ui.touch-punch.min.js"></script>
	<script src="assets/js/jquery.slimscroll.min.js"></script>
	<script src="assets/js/jquery.easy-pie-chart.min.js"></script>
	<script src="assets/js/jquery.sparkline.min.js"></script>
	<script src="assets/js/flot/jquery.flot.min.js"></script>
	<script src="assets/js/flot/jquery.flot.pie.min.js"></script>
	<script src="assets/js/flot/jquery.flot.resize.min.js"></script>
	<script src="js/common.js"></script>
	<script src="assets/js/ace-elements.min.js"></script>
	<script src="assets/js/ace.min.js"></script>
	<script type="text/javascript">
		var height = $(window).height();
		$('.main-content').height(height - 50);

		$(window).resize(function() {
			var h = $(window).height();
			if (h > height) {
				$('.main-content').height(h - 50);
			}
		});
		
		$("#cacheFlush").click(function(){
			$.ajax({
				url : contextPath + '/system',
				type : "POST",
				dataType : 'json',
				data : {
					action : 'updateDate',
				},
				success : function(rs, textStatus, jqXHR) {
					if (rs.success) {
						alert(rs.msg);
					} else{
						alert(rs.msg);
					}
				},
				error : function() {
					$("#loading").hide();
					showMessage("请稍后再试");
				}
			});
			
		});
	</script>
</body>
</html>